#ifndef APPTAB_H
#define APPTAB_H

#include "note.h"
#include "keyword.h"

/// This class declares interfaces and implements behavior common to all tabs
/// of the application. Such as: notifications when note / keyword is created /
/// changed / deleted, updating fonts after they were changed in Settings,
/// etc.
/// It also implements preservation of focus within the tab, due to
/// wxAuiNotebook limitation (see http://trac.wxwidgets.org/ticket/16023).
class AppTab
{
public:

    AppTab() {}

    // TODO: add method to find it's own index number in parent notebook
    // TODO: add focus event handler to preserve focus upon tab switch
    //       see: http://trac.wxwidgets.org/ticket/16023

    //----------------------------------------------------------
    // Notifications

    /// Notification called when new Note is being saved.
    virtual void NotifyNewNote(const Note&) {};

    /// Notification called when existing Note was modified and is being saved.
    virtual void NotifyEditedNote(const Note&) {};

    /// Notification called when existing Note is being deleted.
    virtual void NotifyDeletedNote(const Note&) {};

    /// Notification called when new Keyword is being saved.
    virtual void NotifyNewKeyword(const Keyword&) {};

    /// Notification called when existing Keyword was modified and is being saved.
    virtual void NotifyEditedKeyword(const Keyword&) {};

    /// Notification called when existing Keyword is being deleted.
    virtual void NotifyDeletedKeyword(const Keyword&) {};

    /// Notification called when appearance was updated in settings
    virtual void NotifyChangedAppearance() {};

};

#endif
